package controllersTest;


import java.util.ArrayList;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


import java.util.ArrayList;

import junit.framework.Assert;
import junit.framework.TestCase;

import org.springframework.context.ApplicationContext;
import org.testng.annotations.Test;

import controllers.*;
import daos.*;
import model.*;

public class AssignDesiredCoursesControllerTest {

	private ApplicationContext applicationContext;
	
	
	@Test
	public void testCase1()
	{

        applicationContext = new ClassPathXmlApplicationContext(new String[] {"classpath:persistenceTest/applicationContext.xml"});
				
		ArrayList<Integer> list1 = new ArrayList<Integer>();
		
		list1.add(2);		
		
		AssignCoursesController newController = new AssignCoursesController();
		
		newController.assignCourses(list1,8);
		
		FindStudentController tmp = new FindStudentController();
		
		StudentProfile student = tmp.findStudent(8);
		
		System.out.println("I am glad that i found " + student.getFullName() + " with lesson " + student.getDesiredCourses().get(0).getDescription());

	}
}
